class GiveslecturesController < ApplicationController
  # GET /giveslectures
  # GET /giveslectures.json
  def index
    @giveslectures = Giveslecture.all

    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @giveslectures }
    end
  end

  # GET /giveslectures/1
  # GET /giveslectures/1.json
  def show
    @giveslecture = Giveslecture.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @giveslecture }
    end
  end

  # GET /giveslectures/new
  # GET /giveslectures/new.json
  def new
    @giveslecture = Giveslecture.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @giveslecture }
    end
  end

  # GET /giveslectures/1/edit
  def edit
    @giveslecture = Giveslecture.find(params[:id])
  end

  # POST /giveslectures
  # POST /giveslectures.json
  def create
    @giveslecture = Giveslecture.new(params[:giveslecture])

    respond_to do |format|
      if @giveslecture.save
        format.html { redirect_to @giveslecture, notice: 'Giveslecture was successfully created.' }
        format.json { render json: @giveslecture, status: :created, location: @giveslecture }
      else
        format.html { render action: "new" }
        format.json { render json: @giveslecture.errors, status: :unprocessable_entity }
      end
    end
  end

  # PUT /giveslectures/1
  # PUT /giveslectures/1.json
  def update
    @giveslecture = Giveslecture.find(params[:id])

    respond_to do |format|
      if @giveslecture.update_attributes(params[:giveslecture])
        format.html { redirect_to @giveslecture, notice: 'Giveslecture was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: "edit" }
        format.json { render json: @giveslecture.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /giveslectures/1
  # DELETE /giveslectures/1.json
  def destroy
    @giveslecture = Giveslecture.find(params[:id])
    @giveslecture.destroy

    respond_to do |format|
      format.html { redirect_to giveslectures_url }
      format.json { head :no_content }
    end
  end
end
